import { defineConfig } from '@umijs/max';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const SERVER = {
  dev: '',
  uat: '',
  sit: '',
  pre: '',
  prod: '',
};

export default defineConfig({
  access: {},
  model: {},
  initialState: {},
  request: {},
  layout: {
    ...defaultSettings,
  },
  esbuildMinifyIIFE: true,
  antd: {
    theme: {
      token: {
        colorPrimary: '#be0915',
        colorLink: '#be0915',
        colorInfo: '#be0915',
      },
    },
  },

  lessLoader: {
    lessOptions: {
      javascriptEnabled: true,
    },
  },
  history: {
    type: 'browser',
  },
  manifest: {
    basePath: '/',
  },
  define: {
    API_CONFIGS: {
      server: SERVER['prod' as keyof typeof SERVER],
      prefix: '/v1',
    },
  },
  proxy: proxy['dev'],
  routes,
  npmClient: 'yarn',
  publicPath: '/code-muse/',
  base: '/code-muse/',
});
